package io.summer.auth.controller;


import cn.hutool.core.io.FileUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Moonlight
 */
@RestController
@Slf4j
@RequestMapping("/auth/internal")
public class InternalController {
  @Value("${summer.auth.public-key}")
  private String publicKey;

  @GetMapping("/publicKey")
  public Object publicKey() {
    return FileUtil.readBytes(publicKey);
  }

  @GetMapping("/test")
  public Object test() {
    return "1";
  }
}
